def dfs(str1,ans,path,used):
    #print(path)
    n=len(str1)
    if len(path)==n:
        #print('*')
        ans.append(path)
    for i in range(n):
        if i>0 and str1[i]==str1[i-1] and used[i-1]==0: continue
        if used[i]==0:
            used[i]=1
            path+=str1[i]
            dfs(str1,ans,path,used)
            path=path[:-1]
            used[i]=0
        

def solve(str1):
    str1=''.join(sorted(str1))
    ans=[]
    used=[0]*len(str1)
    dfs(str1,ans,'',used)
    return ans 

ans=solve(input())
print(ans)

